package com.hcxy.filetransform.adapter;

import java.text.SimpleDateFormat;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.hcxy.filetransform.R;
import com.hcxy.filetransform.domain.FileTranslateInfo;
import com.hcxy.filetransform.domain.TransformLog;
import com.lidroid.xutils.view.annotation.ViewInject;

public class SendTextViewHolder extends BaseViewHolder<TransformLog> {

	@ViewInject(R.id.tv_time)
	private TextView tv_time;
	@ViewInject(R.id.tv_message)
	private TextView tv_message;
	
	
	public SendTextViewHolder(Context context, ViewGroup root,
			OnRecyclerViewListener onRecyclerViewListener) {
		super(context, root, R.layout.item_chat_send_text, onRecyclerViewListener);
	}

	@Override
	public void bindData(TransformLog t) {
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		String msg = t.getData();
		tv_message.setText(msg);
		String time =dateFormat.format(t.getDate()) ;
		tv_time.setText(time);
	}
	public void showTime(boolean isShow) {
	    tv_time.setVisibility(isShow ? View.VISIBLE : View.GONE);
	  }

}
